<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhenzhen
 * Date: 12-9-19
 * Time: 下午12:29
 * To change this template use File | Settings | File Templates.
 */
class tag{
/*
public $tag=array(
    'timenum'=>array('block'=>0)
); */

function _arclist($attr,$content){
    $listnum=!isset($attr['num'])? 5 :$attr['num'];
    $titlen=!isset($attr['titlen'])?20:$attr['titlen'];
    //$chnall=!isset($attr['chnall'])? 1:$attr['chnall'];
   // $chnall=is_numeric($chnall)?"catid=".$chnall:"catid=\".".$chnall.".\"";
    $str='';
    $str.='<?php
		$db=V("work_orig");
		$db->view=array(
		 "user"=>array(
		   "type"=>"inner",
		   "on"=>"user.uid=work_orig.uid"
		 ),
		);
		$row=$db->limit("'.$listnum.'")->all();?>';
        $str.='
			<?php foreach ($row as $field):
				$field["wtitle"]=mb_substr($field["wtitle"],0,'.$titlen.',"utf-8");
				//$field["time"]=date("Y-m-d",$field["time"]);
			?>

		';
    $str.=$content;
    $str.='<?php endforeach;?>';

    return $str;
}


}